<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>2.Object.defineProperty引起的死循环</title>
	</head>
	<body>
		<script type="text/javascript" >
			let person = {
				name:'强哥',
				sex:'女'
			}

			Object.defineProperty(person,'age',{
				get(){
					return 18
				},
				set(value){
					console.log('@')
					person.age = value //会引起死循环
				}
			})


		</script>
	</body>
</html>